module Language.Lsl.Internal.FuncSigs(
    funcDescriptions,
    funcMeta,
    funcSigs,
    findSig,
    convertArgs) where

import Data.List(find)
import Language.Lsl.Internal.Type(LSLType(..), convertValues,LSLValue)

-- TODO: import real info into funcMeta, and derive funcSigs from that
funcMeta :: [(String,LSLType,[(String,LSLType)],String)]
funcMeta =
    let dummyNames = zipWith (++) (repeat "arg") (map show [1..])
        sig2Meta (name,rt,args) = 
            let (argNames,description) = case lookup name funcDescriptions of
                    Nothing -> (dummyNames,"no description")
                    Just (names,desc) -> (names ++ dummyNames,desc)
            in (name, rt,zip argNames args,description)
    in map sig2Meta funcSigs
        
findSig name = find (\ (fname,_,_) -> name == fname) funcSigs

convertArgs :: RealFrac a => String -> [LSLValue a] -> [LSLValue a]
convertArgs name args = case findSig name of
    Nothing -> args
    Just (_,_,argTypes) -> convertValues argTypes args

funcSigs :: [(String,LSLType,[LSLType])]
funcSigs = [
    ("llAbs",LLInteger,[LLInteger]),
    ("llAcos",LLFloat,[LLFloat]),
    ("llAddToLandBanList",LLVoid,[LLKey, LLFloat]),
    ("llAddToLandPassList",LLVoid,[LLKey, LLFloat]),
    ("llAdjustSoundVolume",LLVoid,[LLFloat]),
    ("llAllowInventoryDrop",LLVoid,[LLInteger]),
    ("llAngleBetween",LLFloat,[LLRot,LLRot]),
    ("llApplyImpulse",LLVoid,[LLVector,LLInteger]),
    ("llApplyRotationalImpulse",LLVoid,[LLVector,LLInteger]),
    ("llAsin",LLFloat,[LLFloat]),
    ("llAtan2",LLFloat,[LLFloat,LLFloat]),
    ("llAttachToAvatar",LLVoid,[LLInteger]),
    ("llAvatarOnLinkSitTarget",LLKey,[LLInteger]),
    ("llAvatarOnSitTarget",LLKey,[]),
    ("llAxes2Rot",LLRot,[LLVector,LLVector,LLVector]),
    ("llAxisAngle2Rot",LLRot,[LLVector,LLFloat]),
    ("llBase64ToInteger",LLInteger,[LLString]),
    ("llBase64ToString",LLString,[LLString]),
    ("llBreakAllLinks",LLVoid,[]),
    ("llBreakLink",LLVoid,[LLInteger]),
    ("llCastRay",LLList,[LLVector,LLVector,LLList]),
    ("llCSV2List",LLList,[LLString]),
    ("llCeil",LLInteger,[LLFloat]),
    ("llClearCameraParams",LLVoid,[]),
    ("llClearLinkMedia",LLInteger,[LLInteger,LLInteger]),
    ("llClearPrimMedia",LLInteger,[LLInteger]),
    ("llCloseRemoteDataChannel",LLVoid,[LLKey]),
    ("llCloud",LLFloat,[LLVector]),
    ("llCollisionFilter",LLVoid,[LLString,LLKey,LLInteger]),
    ("llCollisionSound",LLVoid,[LLString,LLFloat]),
    ("llCollisionSprite",LLVoid,[LLString]),
    ("llCos",LLFloat,[LLFloat]),
    ("llCreateLink",LLVoid,[LLKey,LLInteger]),
    ("llDeleteSubList",LLList,[LLList,LLInteger,LLInteger]),
    ("llDeleteSubString",LLString,[LLString,LLInteger,LLInteger]),
    ("llDetachFromAvatar",LLVoid,[]),
    ("llDetectedGrab",LLVector,[LLInteger]),
    ("llDetectedGroup",LLInteger,[LLInteger]),
    ("llDetectedKey",LLKey,[LLInteger]),
    ("llDetectedLinkNumber",LLInteger,[LLInteger]),
    ("llDetectedName",LLString,[LLInteger]),
    ("llDetectedOwner",LLKey,[LLInteger]),
    ("llDetectedPos",LLVector,[LLInteger]),
    ("llDetectedRot",LLRot,[LLInteger]),
    ("llDetectedTouchBinormal", LLVector,[LLInteger]),
    ("llDetectedTouchFace", LLInteger,[LLInteger]),
    ("llDetectedTouchNormal", LLVector,[LLInteger]),
    ("llDetectedTouchPos", LLVector,[LLInteger]),
    ("llDetectedTouchST", LLVector,[LLInteger]),
    ("llDetectedTouchUV", LLVector,[LLInteger]),
    ("llDetectedType",LLInteger,[LLInteger]),
    ("llDetectedVel",LLVector,[LLInteger]),
    ("llDialog",LLVoid,[LLKey,LLString,LLList,LLInteger]),
    ("llDie",LLVoid,[]),
    ("llDumpList2String",LLString,[LLList,LLString]),
    ("llEdgeOfWorld",LLInteger,[LLVector,LLVector]),
    ("llEjectFromLand",LLVoid,[LLKey]),
    ("llEmail",LLVoid,[LLString,LLString,LLString]),
    ("llEscapeURL",LLString,[LLString]),
    ("llEuler2Rot",LLRot,[LLVector]),
    ("llFabs",LLFloat,[LLFloat]),
    ("llFloor",LLInteger,[LLFloat]),
    ("llForceMouselook",LLVoid,[LLInteger]),
    ("llFrand",LLFloat,[LLFloat]),
    ("llGetAccel",LLVector,[]),
    ("llGetAgentInfo",LLInteger,[LLKey]),
    ("llGetAgentSize",LLVector,[LLKey]),
    ("llGetAgentLanguage", LLString, [LLKey]),
    ("llGetAlpha",LLFloat,[LLInteger]),
    ("llGetAndResetTime",LLFloat,[]),
    ("llGetAnimation",LLString,[LLKey]),
    ("llGetAnimationList",LLList,[LLKey]),
    ("llGetAttached",LLInteger,[]),
    ("llGetBoundingBox",LLList,[LLKey]),
    ("llGetCameraPos",LLVector,[]),
    ("llGetCameraRot",LLRot,[]),
    ("llGetCenterOfMass",LLVector,[]),
    ("llGetColor",LLVector,[LLInteger]),
    ("llGetCreator",LLKey,[]),
    ("llGetDate",LLString,[]),
    ("llGetDisplayName",LLString,[LLKey]),
    ("llGetEnergy",LLFloat,[]),
    ("llGetEnv",LLString,[LLString]),
    ("llGetForce",LLVector,[]),
    ("llGetFreeMemory",LLInteger,[]), -- SEMI-INTERNAL!!!
    ("llGetFreeURLs",LLInteger,[]), 
    ("llGetGMTclock",LLFloat,[]),
    ("llGetGeometricCenter",LLVector,[]),
    ("llGetHTTPHeader",LLString, [LLKey,LLString]),
    ("llGetInventoryCreator",LLKey,[LLString]),
    ("llGetInventoryKey",LLKey,[LLString]),
    ("llGetInventoryName",LLString,[LLInteger,LLInteger]),
    ("llGetInventoryNumber",LLInteger,[LLInteger]),
    ("llGetInventoryPermMask",LLInteger,[LLString,LLInteger]),
    ("llGetInventoryType",LLInteger,[LLString]),
    ("llGetKey",LLKey,[]),
    ("llGetLandOwnerAt",LLKey,[LLVector]),
    ("llGetLinkKey",LLKey,[LLInteger]),
    ("llGetLinkMedia",LLList,[LLInteger,LLInteger,LLList]), 
    ("llGetLinkName",LLString,[LLInteger]),
    ("llGetLinkNumber",LLInteger,[]),
    ("llGetLinkNumberOfSides",LLInteger,[LLInteger]),
    ("llGetLinkPrimitiveParams",LLList,[LLInteger,LLList]),
    ("llGetListEntryType",LLInteger,[LLList,LLInteger]),
    ("llGetListLength",LLInteger,[LLList]),
    ("llGetLocalPos",LLVector,[]),
    ("llGetLocalRot",LLRot,[]),
    ("llGetMemoryLimit",LLInteger,[]),
    ("llGetMass",LLFloat,[]),
    ("llGetNextEmail",LLVoid,[LLString,LLString]),
    ("llGetNotecardLine",LLKey,[LLString,LLInteger]),
    ("llGetNumberOfNotecardLines",LLKey,[LLString]),
    ("llGetNumberOfPrims",LLInteger,[]),
    ("llGetNumberOfSides",LLInteger,[]),
    ("llGetObjectDesc",LLString,[]),
    ("llGetObjectDetails",LLList,[LLKey,LLList]),
    ("llGetObjectMass",LLFloat,[LLKey]),
    ("llGetObjectName",LLString,[]),
    ("llGetObjectPermMask",LLInteger,[LLInteger]),
    ("llGetObjectPrimCount",LLInteger,[LLKey]),
    ("llGetOmega",LLVector,[]),
    ("llGetOwner",LLKey,[]),
    ("llGetOwnerKey",LLKey,[LLKey]),
    ("llGetParcelDetails",LLList,[LLVector,LLList]),
    ("llGetParcelFlags",LLInteger,[LLVector]),
    ("llGetParcelMaxPrims",LLInteger,[LLVector,LLInteger]),
    ("llGetParcelPrimCount",LLInteger,[LLVector,LLInteger,LLInteger]),
    ("llGetParcelPrimOwners",LLList,[LLVector]),
    ("llGetPermissions",LLInteger,[]),
    ("llGetPermissionsKey",LLKey,[]),
    ("llGetPos",LLVector,[]),
    ("llGetPrimitiveParams",LLList,[LLList]),
    ("llGetPrimMediaParams",LLList,[LLInteger,LLList]), 
    ("llGetRegionAgentCount",LLInteger,[]),
    ("llGetRegionCorner",LLVector,[]),
    ("llGetRegionFPS",LLFloat,[]),
    ("llGetRegionFlags",LLInteger,[]),
    ("llGetRegionName",LLString,[]),
    ("llGetRegionTimeDilation",LLFloat,[]),
    ("llRequestDisplayName",LLKey,[LLKey]),
    ("llGetRootPosition",LLVector,[]),
    ("llGetRootRotation",LLRot,[]),
    ("llGetRot",LLRot,[]),
    ("llGetScale",LLVector,[]),
    ("llGetScriptName",LLString,[]),
    ("llGetScriptState",LLInteger,[LLString]),
    ("llGetSimulatorHostname",LLString,[]),
    ("llGetSPMaxMemory",LLInteger,[]),
    ("llGetStartParameter",LLInteger,[]),
    ("llGetStatus",LLInteger,[LLInteger]),
    ("llGetSubString",LLString,[LLString,LLInteger,LLInteger]),
    ("llGetSunDirection",LLVector,[]),
    ("llGetTexture",LLString,[LLInteger]),
    ("llGetTextureOffset",LLVector,[LLInteger]),
    ("llGetTextureRot",LLFloat,[LLInteger]),
    ("llGetTextureScale",LLVector,[LLInteger]),
    ("llGetTime",LLFloat,[]),
    ("llGetTimeOfDay",LLFloat,[]),
    ("llGetTimestamp",LLString,[]),
    ("llGetTorque",LLVector,[]),
    ("llGetUsedMemory",LLInteger,[]),
    ("llGetUnixTime",LLInteger,[]),
    ("llGetUsername",LLString,[LLKey]),
    ("llGetVel",LLVector,[]),
    ("llGetWallclock",LLFloat,[]),
    ("llGiveInventory",LLVoid,[LLKey,LLString]),
    ("llGiveInventoryList",LLVoid,[LLKey,LLString,LLList]),
    ("llGiveMoney",LLInteger,[LLKey,LLInteger]),
    ("llGodLikeRezObject",LLVoid,[LLKey,LLVector]),
    ("llGround",LLFloat,[LLVector]),
    ("llGroundContour",LLVector,[LLVector]),
    ("llGroundNormal",LLVector,[LLVector]),
    ("llGroundRepel",LLVoid,[LLFloat,LLInteger,LLFloat]),
    ("llGroundSlope",LLVector,[LLVector]),
    ("llHTTPRequest",LLKey,[LLString,LLList,LLString]),
    ("llHTTPResponse",LLVoid,[LLKey,LLInteger,LLString]),
    ("llInsertString",LLString,[LLString,LLInteger,LLString]),
    ("llInstantMessage",LLVoid,[LLKey,LLString]),
    ("llIntegerToBase64",LLString,[LLInteger]),
    ("llKey2Name",LLString,[LLKey]),
    ("llLinkParticleSystem",LLVoid,[LLInteger,LLList]),
    ("llLinkSitTarget",LLVoid,[LLInteger,LLVector,LLRot]),
    ("llList2CSV",LLString,[LLList]),
    ("llList2Float",LLFloat,[LLList,LLInteger]),
    ("llList2Integer",LLInteger,[LLList,LLInteger]),
    ("llList2Key",LLKey,[LLList,LLInteger]),
    ("llList2List",LLList,[LLList,LLInteger,LLInteger]),
    ("llList2ListStrided",LLList,[LLList,LLInteger,LLInteger,LLInteger]),
    ("llList2Rot",LLRot,[LLList,LLInteger]),
    ("llList2String",LLString,[LLList,LLInteger]),
    ("llList2Vector",LLVector,[LLList,LLInteger]),
    ("llListFindList",LLInteger,[LLList,LLList]),
    ("llListInsertList",LLList,[LLList,LLList,LLInteger]),
    ("llListRandomize",LLList,[LLList,LLInteger]),
    ("llListReplaceList",LLList,[LLList,LLList,LLInteger,LLInteger]),
    ("llListSort",LLList,[LLList,LLInteger,LLInteger]),
    ("llListStatistics",LLFloat,[LLInteger,LLList]),
    ("llListen",LLInteger,[LLInteger,LLString,LLKey,LLString]),
    ("llListenControl",LLVoid,[LLInteger,LLInteger]),
    ("llListenRemove",LLVoid,[LLInteger]),
    ("llLoadURL",LLVoid,[LLKey,LLString,LLString]),
    ("llLog",LLFloat,[LLFloat]),
    ("llLog10",LLFloat,[LLFloat]),
    ("llLookAt",LLVoid,[LLVector,LLFloat,LLFloat]),
    ("llLoopSound",LLVoid,[LLString,LLFloat]),
    ("llLoopSoundMaster",LLVoid,[LLString,LLFloat]),
    ("llLoopSoundSlave",LLVoid,[LLString,LLFloat]),
    ("llMD5String",LLString,[LLString,LLInteger]),
    ("llMakeExplosion",LLVoid,[LLInteger,LLFloat,LLFloat,LLFloat,LLFloat,LLString,LLVector]),
    ("llMakeFire",LLVoid,[LLInteger,LLFloat,LLFloat,LLFloat,LLFloat,LLString,LLVector]),
    ("llMakeFountain",LLVoid,[LLInteger,LLFloat,LLFloat,LLFloat,LLFloat,LLInteger,LLString,LLVector,LLFloat]),
    ("llMakeSmoke",LLVoid,[LLInteger,LLFloat,LLFloat,LLFloat,LLFloat,LLString,LLVector]),
    ("llMapDestination",LLVoid,[LLString,LLVector,LLVector]),
    ("llMessageLinked",LLVoid,[LLInteger,LLInteger,LLString,LLKey]),
    ("llMinEventDelay",LLVoid,[LLFloat]),
    ("llModPow",LLInteger,[LLInteger,LLInteger,LLInteger]),
    ("llModifyLand",LLVoid,[LLInteger,LLInteger]),
    ("llMoveToTarget",LLVoid,[LLVector,LLFloat]),
    ("llOffsetTexture",LLVoid,[LLFloat,LLFloat,LLInteger]),
    ("llOpenRemoteDataChannel",LLVoid,[]),
    ("llOverMyLand",LLInteger,[LLKey]),
    ("llOwnerSay",LLVoid,[LLString]),
    ("llParcelMediaCommandList",LLVoid,[LLList]),
    ("llParcelMediaQuery",LLList,[LLList]),
    ("llParseString2List",LLList,[LLString,LLList,LLList]),
    ("llParseStringKeepNulls",LLList,[LLString,LLList,LLList]),
    ("llParticleSystem",LLVoid,[LLList]),
    ("llPassCollisions",LLVoid,[LLInteger]),
    ("llPassTouches",LLVoid,[LLInteger]),
    ("llPlaySound",LLVoid,[LLString,LLFloat]),
    ("llPlaySoundSlave",LLVoid,[LLString,LLFloat]),
    ("llPointAt",LLVoid,[LLVector]),
    ("llPow",LLFloat,[LLFloat,LLFloat]),
    ("llPreloadSound",LLVoid,[LLString]),
    ("llPushObject",LLVoid,[LLKey,LLVector,LLVector,LLInteger]),
    ("llRefreshPrimURL",LLVoid,[]),
    ("llRegionSay",LLVoid,[LLInteger,LLString]),
    ("llRegionSayTo",LLVoid,[LLKey,LLInteger,LLString]),
    ("llReleaseCamera",LLVoid,[LLKey]),
    ("llReleaseControls",LLVoid,[]),
    ("llReleaseURL",LLVoid, [LLString]),
    ("llRemoteDataReply",LLVoid,[LLKey,LLKey,LLString,LLInteger]),
    ("llRemoteDataSetRegion",LLVoid,[]),
    ("llRemoteLoadScript",LLVoid,[LLKey,LLString,LLInteger,LLInteger]), -- deprecated/removed
    ("llRemoteLoadScriptPin",LLVoid,[LLKey,LLString,LLInteger,LLInteger,LLInteger]),
    ("llRemoveFromLandBanList",LLVoid,[LLKey]),
    ("llRemoveFromLandPassList",LLVoid,[LLKey]),
    ("llRemoveInventory",LLVoid,[LLString]),
    ("llRemoveVehicleFlags",LLVoid,[LLInteger]),
    ("llRequestAgentData",LLKey,[LLKey,LLInteger]),
    ("llRequestInventoryData",LLKey,[LLString]),
    ("llRequestPermissions",LLVoid,[LLKey,LLInteger]),
    ("llRequestSecureURL", LLKey, []),
    ("llRequestURL", LLKey, []),
    ("llRequestUsername",LLKey,[LLKey]),
    ("llRequestSimulatorData",LLKey,[LLString,LLInteger]),
    ("llResetLandBanList",LLVoid,[]),
    ("llResetLandPassList",LLVoid,[]),
    ("llResetOtherScript",LLVoid,[LLString]),
    ("llResetScript",LLVoid,[]),
    ("llResetTime",LLVoid,[]),
    ("llRezAtRoot",LLVoid,[LLString,LLVector,LLVector,LLRot,LLInteger]),
    ("llRezObject",LLVoid,[LLString,LLVector,LLVector,LLRot,LLInteger]),
    ("llRot2Angle",LLFloat,[LLRot]),
    ("llRot2Axis",LLVector,[LLRot]),
    ("llRot2Euler",LLVector,[LLRot]),
    ("llRot2Fwd",LLVector,[LLRot]),
    ("llRot2Left",LLVector,[LLRot]),
    ("llRot2Up",LLVector,[LLRot]),
    ("llRotBetween",LLRot,[LLVector,LLVector]),
    ("llRotLookAt",LLVoid,[LLRot,LLFloat,LLFloat]),
    ("llRotTarget",LLInteger,[LLRot,LLFloat]),
    ("llRotTargetRemove",LLVoid,[LLInteger]),
    ("llRotateTexture",LLVoid,[LLFloat,LLInteger]),
    ("llRound",LLInteger,[LLFloat]),
    ("llSameGroup",LLInteger,[LLKey]),
    ("llSay",LLVoid,[LLInteger,LLString]),
    ("llScaleTexture",LLVoid,[LLFloat,LLFloat,LLInteger]),
    ("llScriptDanger",LLInteger,[LLVector]),
    ("llScriptProfiler",LLVoid,[LLInteger]),
    ("llSendRemoteData",LLKey,[LLKey,LLString,LLInteger,LLString]),
    ("llSensor",LLVoid,[LLString,LLKey,LLInteger,LLFloat,LLFloat]),
    ("llSensorRemove",LLVoid,[]),
    ("llSensorRepeat",LLVoid,[LLString,LLKey,LLInteger,LLFloat,LLFloat,LLFloat]),
    ("llSetAlpha",LLVoid,[LLFloat,LLInteger]),
    ("llSetAngularVelocity",LLVoid,[LLVector,LLInteger]),
    ("llSetBuoyancy",LLVoid,[LLFloat]),
    ("llSetCameraAtOffset",LLVoid,[LLVector]),
    ("llSetCameraEyeOffset",LLVoid,[LLVector]),
    ("llSetCameraParams",LLVoid,[LLList]),
    ("llSetClickAction",LLVoid,[LLInteger]),
    ("llSetContentType",LLVoid,[LLKey,LLInteger]),
    ("llSetColor",LLVoid,[LLVector,LLInteger]),
    ("llSetDamage",LLVoid,[LLFloat]),
    ("llSetForce",LLVoid,[LLVector,LLInteger]),
    ("llSetForceAndTorque",LLVoid,[LLVector,LLVector,LLInteger]),
    ("llSetHoverHeight",LLVoid,[LLFloat,LLInteger,LLFloat]),
    ("llSetLinkAlpha",LLVoid,[LLInteger,LLFloat,LLInteger]),
    ("llSetLinkCamera",LLVoid,[LLInteger,LLVector,LLVector]),
    ("llSetLinkColor",LLVoid,[LLInteger,LLVector,LLInteger]),
    ("llSetLinkMedia",LLInteger,[LLInteger,LLInteger,LLList]),
    ("llSetLinkPrimitiveParams",LLVoid,[LLInteger,LLList]),
    ("llSetLinkPrimitiveParamsFast",LLVoid,[LLInteger,LLList]),
    ("llSetLinkTexture",LLVoid,[LLInteger,LLString,LLInteger]),
    ("llSetLinkTextureAnim",LLVoid,[LLInteger,LLInteger,LLInteger,LLInteger,LLInteger,LLFloat,LLFloat,LLFloat]),
    ("llSetLocalRot",LLVoid,[LLRot]),
    ("llSetMemoryLimit",LLInteger,[LLInteger]),
    ("llSetObjectDesc",LLVoid,[LLString]),
    ("llSetObjectName",LLVoid,[LLString]),
    ("llSetParcelMusicURL",LLVoid,[LLString]),
    ("llSetPayPrice",LLVoid,[LLInteger,LLList]),
    ("llSetPos",LLVoid,[LLVector]),
    ("llSetPrimMediaParams",LLInteger,[LLInteger,LLList]),
    ("llSetPrimURL",LLVoid,[LLString]),
    ("llSetPrimitiveParams",LLVoid,[LLList]),
    ("llSetRemoteScriptAccessPin",LLVoid,[LLInteger]),
    ("llSetRot",LLVoid,[LLRot]),
    ("llSetScale",LLVoid,[LLVector]),
    ("llSetScriptState",LLVoid,[LLString,LLInteger]),
    ("llSetSitText",LLVoid,[LLString]),
    ("llSetSoundQueueing",LLVoid,[LLInteger]),
    ("llSetSoundRadius",LLVoid,[LLFloat]),
    ("llSetStatus",LLVoid,[LLInteger,LLInteger]),
    ("llSetText",LLVoid,[LLString,LLVector,LLFloat]),
    ("llSetTexture",LLVoid,[LLString,LLInteger]),
    ("llSetTextureAnim",LLVoid,[LLInteger,LLInteger,LLInteger,LLInteger,LLFloat,LLFloat,LLFloat]),
    ("llSetTimerEvent",LLVoid,[LLFloat]),
    ("llSetTorque",LLVoid,[LLVector,LLInteger]),
    ("llSetTouchText",LLVoid,[LLString]),
    ("llSetVehicleFlags",LLVoid,[LLInteger]),
    ("llSetVehicleFloatParam",LLVoid,[LLInteger,LLFloat]),
    ("llSetVehicleRotationParam",LLVoid,[LLInteger,LLRot]),
    ("llSetVehicleType",LLVoid,[LLInteger]),
    ("llSetVehicleVectorParam",LLVoid,[LLInteger,LLVector]),
    ("llSetVelocity",LLVoid,[LLVector,LLInteger]),
    ("llShout",LLVoid,[LLInteger,LLString]),
    ("llSin",LLFloat,[LLFloat]),
    ("llSitTarget",LLVoid,[LLVector,LLRot]),
    ("llSleep",LLVoid,[LLFloat]),
    ("llSound",LLVoid,[LLString,LLFloat,LLInteger,LLInteger]), -- deprecated
    ("llSoundPreload",LLVoid,[LLString]),
    ("llSqrt",LLFloat,[LLFloat]),
    ("llStartAnimation",LLVoid,[LLString]),
    ("llStopAnimation",LLVoid,[LLString]),
    ("llStopHover",LLVoid,[]),
    ("llStopLookAt",LLVoid,[]),
    ("llStopMoveToTarget",LLVoid,[]),
    ("llStopPointAt",LLVoid,[]),
    ("llStopSound",LLVoid,[]),
    ("llStringLength",LLInteger,[LLString]),
    ("llStringToBase64",LLString,[LLString]),
    ("llStringTrim",LLString,[LLString,LLInteger]),
    ("llSubStringIndex",LLInteger,[LLString,LLString]),
    ("llSHA1String",LLString, [LLString]),
    ("llTakeCamera",LLVoid,[LLKey]),
    ("llTakeControls",LLVoid,[LLInteger,LLInteger,LLInteger]),
    ("llTan",LLFloat,[LLFloat]),
    ("llTarget",LLInteger,[LLVector,LLFloat]),
    ("llTargetOmega",LLVoid,[LLVector,LLFloat,LLFloat]),
    ("llTargetRemove",LLVoid,[LLInteger]),
    ("llTeleportAgentHome",LLVoid,[LLKey]),
    ("llTextBox",LLVoid,[LLKey,LLString,LLInteger]),
    ("llToLower",LLString,[LLString]),
    ("llToUpper",LLString,[LLString]),
    ("llTriggerSound",LLVoid,[LLString,LLFloat]),
    ("llTriggerSoundLimited",LLVoid,[LLString,LLFloat,LLVector,LLVector]),
    ("llUnSit",LLVoid,[LLKey]),
    ("llUnescapeURL",LLString,[LLString]),
    ("llVecDist",LLFloat,[LLVector,LLVector]),
    ("llVecMag",LLFloat,[LLVector]),
    ("llVecNorm",LLVector,[LLVector]),
    ("llVolumeDetect",LLVoid,[LLInteger]),
    ("llWater",LLFloat,[LLVector]),
    ("llWhisper",LLVoid,[LLInteger,LLString]),
    ("llWind",LLVector,[LLVector]),
    ("llXorBase64Strings",LLString,[LLString,LLString]),
    ("llXorBase64StringsCorrect",LLString,[LLString,LLString])]
    
funcDescriptions = [    
    ("llSin",(["theta"],"theta in radians\n")),
    ("llCos",(["theta"],"theta in radians\n")),
    ("llTan",(["theta"],"theta radians\n")),
    ("llAtan2",(["y","x"],"")),
    ("llSqrt",(["val"],"returns 0 and triggers a Math Error for imaginary results\n")),
    ("llPow",(["base","exponent"],"returns 0 and triggers Math Error for imaginary results\n")),
    ("llAbs",(["val"],"")),
    ("llFabs",(["val"],"")),
    ("llFrand",(["mag"],"returns random number in range [0,mag)\n")),
    ("llFloor",(["val"],"returns largest integer value &lt;= val\n")),
    ("llCeil",(["val"],"returns smallest integer value >= val\n")),
    ("llRound",(["val"],"returns val rounded to the nearest integer\n")),
    ("llVecMag",(["v"],"returns the magnitude of v\n")),
    ("llVecNorm",(["v"],"returns the v normalized\n")),
    ("llVecDist",(["v1","v2"],"returns the 3D distance between v1 and v2\n")),
    ("llRot2Euler",(["q"],"returns the Euler representation (roll, pitch, yaw) of q\n")),
    ("llEuler2Rot",(["v"],"returns the rotation representation of Euler Angles v\n")),
    ("llAxes2Rot",(["fwd","left","up"],"returns the rotation defined by the coordinate axes\n")),
    ("llRot2Fwd",(["q"],"returns the forward vector defined by q\n")),
    ("llRot2Left",(["q"],"returns the left vector defined by q\n")),
    ("llRot2Up",(["q"],"returns the up vector defined by q\n")),
    ("llRotBetween",(["v1","v2"],"returns the rotation to rotate v1 to v2\n")),
    ("llWhisper",(["channel","msg"],"whispers msg on channel\n")),
    ("llSay",(["channel","msg"],"says msg on channel\n")),
    ("llRegionSay",(["channel","msg"],"Broadcasts message on the specified chat channel to the whole region.\n")),
    ("llShout",(["channel","msg"],"shouts msg on channel\n")),
    ("llListen",(["channel","name","id","msg"],"sets a callback for msg on channel from name and id (name, id, and/or msg can be empty) and returns an identifier that can be used to deactivate or remove the listen\n")),
    ("llListenControl",(["number","active"],"makes a listen event callback active or inactive\n")),
    ("llListenRemove",(["number"],"removes listen event callback number\n")),
    ("llSensor",(["name","id","type","range","arc"],"Performs a single scan for name and id with type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within range meters and arc radians of forward vector (name, id, and/or keytype can be empty or 0)\n")),
    ("llSensorRepeat",(["name","id","type","range","arc","rate"],"sets a callback for name and id with type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within range meters and arc radians of forward vector (name, id, and/or keytype can be empty or 0) and repeats every rate seconds\n")),
    ("llSensorRemove",([],"removes sensor\n")),
    ("llDetectedName",(["number"],"returns the name of detected object number (returns empty string if number is not valid sensed object)\n")),
    ("llDetectedKey",(["number"],"returns the key of detected object number (returns empty key if number is not valid sensed object)\n")),
    ("llDetectedOwner",(["number"],"returns the key of detected object's owner (returns empty key if number is not valid sensed object)\n")),
    ("llDetectedType",(["number"],"returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object (returns 0 if number is not valid sensed object)\n")),
    ("llDetectedPos",(["number"],"returns the position of detected object number (returns &lt;0,0,0&gt; if number is not valid sensed object)\n")),
    ("llDetectedVel",(["number"],"returns the velocity of detected object number (returns &lt;0,0,0&gt; if number is not valid sensed object)\n")),
    ("llDetectedGrab",(["number"],"returns the grab offset of the user touching object (returns &lt;0,0,0&gt; if number is not valid sensed object)\n")),
    ("llDetectedRot",(["number"],"returns the rotation of detected object number (returns &lt;0,0,0,1&gt; if number is not valid sensed object)\n")),
    ("llDetectedGroup",(["number"],"Returns TRUE if detected object is part of same group as owner\n")),
    ("llDetectedLinkNumber",(["number"],"returns the link position of the triggered event for touches and collisions only\n")),
    ("llDie",([],"deletes the object\n")),
    ("llGround",(["v"],"returns the ground height below the object position + v\n")),
    ("llCloud",(["v"],"returns the cloud density at the object position + v\n")),
    ("llWind",(["v"],"returns the wind velocity at the object position + v\n")),
    ("llSetStatus",(["status","value"],"sets status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB,\nSTATUS_ROTATE_X, STATUS_ROTATE_Y, and/or STATUS_ROTATE_Z) to value\n")),
    ("llGetStatus",(["status"],"gets value of status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB,\nSTATUS_ROTATE_X, STATUS_ROTATE_Y, and/or STATUS_ROTATE_Z)\n")),
    ("llSetScale",(["scale"],"sets the scale\n")),
    ("llGetScale",([],"gets the scale\n")),
    ("llSetColor",(["color","face"],"sets the color\n")),
    ("llGetAlpha",(["face"],"gets the alpha\n")),
    ("llSetAlpha",(["alpha","face"],"sets the alpha\n")),
    ("llGetColor",(["face"],"gets the color\n")),
    ("llSetTexture",(["texture","face"],"sets the texture of face\n")),
    ("llScaleTexture",(["scales","scalet","face"],"sets the texture s, t scales for the chosen face\n")),
    ("llOffsetTexture",(["offsets","offsett","face"],"sets the texture s, t offsets for the chosen face\n")),
    ("llRotateTexture",(["rotation","face"],"sets the texture rotation for the chosen face\n")),
    ("llGetTexture",(["face"],"gets the texture of face (if it's a texture in the object inventory, otherwise the key in a string)\n")),
    ("llSetPos",(["pos"],"sets the position (if the script isn't physical)\n")),
    ("llGetPos",([],"gets the position (if the script isn't physical)\n")),
    ("llGetLocalPos",([],"gets the position relative to the root (if the script isn't physical)\n")),
    ("llSetRot",(["rot"],"sets the rotation (if the script isn't physical)\n")),
    ("llGetRot",([],"gets the rotation (if the script isn't physical)\n")),
    ("llGetLocalRot",([],"gets the rotation local to the root (if the script isn't physical)\n")),
    ("llSetForce",(["force","local"],"sets force on object, in local coords if local == TRUE (if the script is physical)\n")),
    ("llGetForce",([],"gets the force (if the script is physical)\n")),
    ("llTarget",(["position","range"],"set positions within range of position as a target and return an ID for the target\n")),
    ("llTargetRemove",(["number"],"removes target number\n")),
    ("llRotTarget",(["rot","error"],"set rotations with error of rot as a rotational target and return an ID for the rotational target\n")),
    ("llRotTargetRemove",(["number"],"removes rotational target number\n")),
    ("llMoveToTarget",(["target","tau"],"critically damp to target in tau seconds (if the script is physical)\n")),
    ("llStopMoveToTarget",([],"Stops critically damped motion\n")),
    ("llApplyImpulse",(["force","local"],"applies impulse to object, in local coords if local == TRUE (if the script is physical)\n")),
    ("llApplyRotationalImpulse",(["force","local"],"applies rotational impulse to object, in local coords if local == TRUE (if the script is physical)\n")),
    ("llSetTorque",(["torque","local"],"sets the torque of object, in local coords if local == TRUE (if the script is physical)\n")),
    ("llGetTorque",([],"gets the torque (if the script is physical)\n")),
    ("llSetForceAndTorque",(["force","torque","local"],"sets the force and torque of object, in local coords if local == TRUE (if the script is physical)\n")),
    ("llGetVel",([],"gets the velocity\n")),
    ("llGetAccel",([],"gets the acceleration\n")),
    ("llGetOmega",([],"gets the omega\n")),
    ("llGetTimeOfDay",([],"gets the time in seconds since Second Life server midnight (or since server up-time; whichever is smaller)\n")),
    ("llGetWallclock",([],"gets the time in seconds since midnight\n")),
    ("llGetTime",([],"gets the time in seconds since creation\n")),
    ("llResetTime",([],"sets the time to zero\n")),
    ("llGetAndResetTime",([],"gets the time in seconds since creation and sets the time to zero\n")),
    ("llSound",(["sound","volume","queue","loop"],"plays sound at volume and whether it should loop or not\n")),
    ("llPlaySound",(["sound","volume"],"plays attached sound once at volume (0.0 - 1.0)\n")),
    ("llLoopSound",(["sound","volume"],"plays attached sound looping indefinitely at volume (0.0 - 1.0)\n")),
    ("llLoopSoundMaster",(["sound","volume"],"plays attached sound looping at volume (0.0 - 1.0), declares it a sync master\n")),
    ("llLoopSoundSlave",(["sound","volume"],"plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master\n")),
    ("llPlaySoundSlave",(["sound","volume"],"plays attached sound once at volume (0.0 - 1.0), synced to next loop of most audible sync master\n")),
    ("llTriggerSound",(["sound","volume"],"plays sound at volume (0.0 - 1.0), centered at but not attached to object\n")),
    ("llStopSound",([],"Stops currently attached sound\n")),
    ("llPreloadSound",(["sound"],"preloads a sound on viewers within range\n")),
    ("llGetSubString",(["src","start","end"],"returns the indicated substring\n")),
    ("llDeleteSubString",(["src","start","end"],"removes the indicated substring and returns the result\n")),
    ("llInsertString",(["dst","position","src"],"inserts src into dst at position and returns the result\n")),
    ("llToUpper",(["src"],"convert src to all upper case and returns the result\n")),
    ("llToLower",(["src"],"convert src to all lower case and returns the result\n")),
    ("llGiveMoney",(["destination","amount"],"transfer amount of money from script owner to destination\n")),
    ("llMakeExplosion",(["particles","scale","vel","lifetime","arc","texture","offset"],"Make a round explosion of particles\n")),
    ("llMakeFountain",(["particles","scale","vel","lifetime","arc","bounce","texture","offset","bounce_offset"],"Make a fountain of particles\n")),
    ("llMakeSmoke",(["particles","scale","vel","lifetime","arc","texture","offset"],"Make smoke like particles\n")),
    ("llMakeFire",(["particles","scale","vel","lifetime","arc","texture","offset"],"Make fire like particles\n")),
    ("llRezObject",(["inventory","pos","vel","rot","param"],"Instanciate owners inventory object at pos with velocity vel and rotation rot with start parameter param\n")),
    ("llLookAt",(["target","strength","damping"],"Cause object name to point it's forward axis towards target\n")),
    ("llStopLookAt",([],"Stop causing object name to point at a target\n")),
    ("llSetTimerEvent",(["sec"],"Cause the timer event to be triggered every sec seconds\n")),
    ("llSleep",(["sec"],"Put script to sleep for sec seconds\n")),
    ("llGetMass",([],"Get the mass of task name that script is attached to\n")),
    ("llCollisionFilter",(["name","id","accept"],"if accept == TRUE, only accept collisions with objects name and id (either is optional), otherwise with objects not name or id\n")),
    ("llTakeControls",(["controls","accept","pass_on"],"Take controls from agent task has permissions for.  If (accept == (controls &amp; input)), send input to task.  If pass_on send to agent also.\n")),
    ("llReleaseControls",([],"Stop taking inputs\n")),
    ("llAttachToAvatar",(["attachment"],"Attach to avatar task has permissions for at point attachment\n")),
    ("llDetachFromAvatar",([],"Drop off of avatar\n")),
    ("llTakeCamera",(["avatar"],"Move avatar's viewpoint to task\n")),
    ("llReleaseCamera",(["avatar"],"Return camera to agent\n")),
    ("llGetOwner",([],"Returns the owner of the task\n")),
    ("llInstantMessage",(["user","message"],"IMs message to the user\n")),
    ("llEmail",(["address","subject","message"],"Sends email to address with subject and message\n")),
    ("llGetNextEmail",(["address","subject"],"Get the next waiting email with appropriate address and/or subject (if blank they are ignored)\n")),
    ("llGetKey",([],"Get the key for the task the script is attached to\n")),
    ("llSetBuoyancy",(["buoyancy"],"Set the tasks buoyancy (0 is none, &lt; 1.0 sinks, 1.0 floats, &gt; 1.0 rises)\n")),
    ("llSetHoverHeight",(["height","water","tau"],"Critically damps to a height (either above ground level or above the higher of land and water if water == TRUE)\n")),
    ("llStopHover",([],"Stop hovering to a height\n")),
    ("llMinEventDelay",(["delay"],"Set the minimum time between events being handled\n")),
    ("llSoundPreload",(["sound"],"preloads a sound on viewers within range\n")),
    ("llRotLookAt",(["target","strength","damping"],"Cause object name to point it's forward axis towards target\n")),
    ("llStringLength",(["str"],"Returns the length of string\n")),
    ("llStartAnimation",(["anim"],"Start animation anim for agent that owns object\n")),
    ("llStopAnimation",(["anim"],"Stop animation anim for agent that owns object\n")),
    ("llPointAt",(["pos"],"Make agent that owns object point at pos\n")),
    ("llStopPointAt",([],"Stop agent that owns object pointing\n")),
    ("llTargetOmega",(["axis","spinrate","gain"],"Attempt to spin at spinrate with strength gain\n")),
    ("llGetStartParameter",([],"Get's the start paramter passed to llRezObject\n")),
    ("llGodLikeRezObject",(["inventory","pos"],"rez directly off of a UUID if owner has dog-bit set\n")),
    ("llRequestPermissions",(["agent","perm"],"ask agent to allow the script to do perm (NB: Debit, ownership, link, joint, and permission requests can only go to the task's owner)\n")),
    ("llGetPermissionsKey",([],"Return agent that permissions are enabled for.  NULL_KEY if not enabled\n")),
    ("llGetPermissions",([],"return what permissions have been enabled\n")),
    ("llGetLinkNumber",([],"Returns what number in a link set the script is attached to (0 means no link, 1 the root, 2 for first child, etc.)\n")),
    ("llSetLinkColor",(["linknumber","color","face"],"If a task exists in the link chain at linknumber, set face to color\n")),
    ("llCreateLink",(["target","parent"],"Attempt to link task script is attached to and target (requires permission PERMISSION_CHANGE_LINKS be set). If parent == TRUE, task script is attached to is the root\n")),
    ("llBreakLink",(["linknum"],"Delinks the task with the given link number (requires permission PERMISSION_CHANGE_LINKS be set)\n")),
    ("llBreakAllLinks",([],"Delinks all tasks in the link set (requires permission PERMISSION_CHANGE_LINKS be set)\n")),
    ("llGetLinkKey",(["linknum"],"Get the key of linknumber in link set\n")),
    ("llGetLinkName",(["linknum"],"Get the name of linknumber in link set\n")),
    ("llGetInventoryNumber",(["type"],"Get the number of items of a given type in the task's inventory.\nValid types: INVENTORY_TEXTURE, INVENTORY_SOUND, INVENTORY_OBJECT, INVENTORY_SCRIPT, INVENTORY_CLOTHING, INVENTORY_BODYPART, INVENTORY_NOTECARD, INVENTORY_LANDMARK, INVENTORY_ALL\n")),
    ("llGetInventoryName",(["type","number"],"Get the name of the inventory item number of type\n")),
    ("llSetScriptState",(["name","run"],"Control the state of a script name.\n")),
    ("llGetEnergy",([],"Returns how much energy is in the object as a percentage of maximum\n")),
    ("llGiveInventory",(["destination","inventory"],"Give inventory to destination\n")),
    ("llRemoveInventory",(["inventory"],"Remove the named inventory item\n")),
    ("llSetText",(["text","color","alpha"],"Set text floating over object\n")),
    ("llWater",(["v"],"returns the water height below the object position + v\n")),
    ("llPassTouches",(["pass"],"if pass == TRUE, touches are passed from children on to parents (default is FALSE)\n")),
    ("llRequestAgentData",(["id","data"],"Requests data about agent id.  When data is available the dataserver event will be raised\n")),
    ("llRequestInventoryData",(["name"],"Requests data from object's inventory object.  When data is available the dataserver event will be raised\n")),
    ("llSetDamage",(["damage"],"Sets the amount of damage that will be done to an object that this task hits.  Task will be killed.\n")),
    ("llTeleportAgentHome",(["id"],"Teleports agent on owner's land to agent's home location\n")),
    ("llModifyLand",(["action","size"],"Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT)\non size (LAND_SMALL_BRUSH, LAND_MEDIUM_BRUSH, LAND_LARGE_BRUSH)\n")),
    ("llCollisionSound",(["impact_sound","impact_volume"],"Suppress default collision sounds, replace default impact sounds with impact_sound (empty string to just suppress)\n")),
    ("llCollisionSprite",(["impact_sprite"],"Suppress default collision sprites, replace default impact sprite with impact_sprite (empty string to just suppress)\n")),
    ("llGetAnimation",(["id"],"Get the currently playing locomotion animation for avatar id\n")),
    ("llResetScript",([],"Resets the script\n")),
    ("llMessageLinked",(["linknum","num","str","id"],"Sends num, str, and id to members of the link set (LINK_ROOT sends to root task in a linked set,\nLINK_SET sends to all tasks,\nLINK_ALL_OTHERS to all other tasks,\nLINK_ALL_CHILDREN to all children,\nLINK_THIS to the task the script it is in)\n")),
    ("llPushObject",(["id","impulse","ang_impulse","local"],"Applies impulse and ang_impulse to object id\n")),
    ("llPassCollisions",(["pass"],"if pass == TRUE, collisions are passed from children on to parents (default is FALSE)\n")),
    ("llGetScriptName",([],"Returns the script name\n")),
    ("llGetNumberOfSides",([],"Returns the number of sides\n")),
    ("llAxisAngle2Rot",(["axis","angle"],"Returns the rotation generated angle about axis\n")),
    ("llRot2Axis",(["rot"],"Returns the rotation axis represented by rot\n")),
    ("llRot2Angle",(["rot"],"Returns the rotation angle represented by rot\n")),
    ("llAcos",(["val"],"Returns the arccosine in radians of val\n")),
    ("llAsin",(["val"],"Returns the arcsine in radians of val\n")),
    ("llAngleBetween",(["a","b"],"Returns angle between rotation a and b\n")),
    ("llGetInventoryKey",(["name"],"Returns the key of the inventory name\n")),
    ("llAllowInventoryDrop",(["add"],"If add == TRUE, users without permissions can still drop inventory items onto task\n")),
    ("llGetSunDirection",([],"Returns the sun direction on the simulator\n")),
    ("llGetTextureOffset",(["side"],"Returns the texture offset of side in the x and y components of a vector\n")),
    ("llGetTextureScale",(["side"],"Returns the texture scale of side in the x and y components of a vector\n")),
    ("llGetTextureRot",(["side"],"Returns the texture rotation of side\n")),
    ("llSubStringIndex",(["source","pattern"],"Finds index in source where pattern first appears (returns -1 if not found)\n")),
    ("llGetOwnerKey",(["id"],"Find the owner of id\n")),
    ("llGetCenterOfMass",([],"Get the object's center of mass\n")),
    ("llListSort",(["src","stride","ascending"],"Sort the list into blocks of stride in ascending order if ascending == TRUE.  Note that sort only works between same types.\n")),
    ("llGetListLength",(["src"],"Get the number of elements in the list\n")),
    ("llList2Integer",(["src","index"],"Copy the integer at index in the list\n")),
    ("llList2Float",(["src","index"],"Copy the float at index in the list\n")),
    ("llList2String",(["src","index"],"Copy the string at index in the list\n")),
    ("llList2Key",(["src","index"],"Copy the key at index in the list\n")),
    ("llList2Vector",(["src","index"],"Copy the vector at index in the list\n")),
    ("llList2Rot",(["src","index"],"Copy the rotation at index in the list\n")),
    ("llList2List",(["src","start","end"],"Copy the slice of the list from start to end\n")),
    ("llDeleteSubList",(["src","start","end"],"Remove the slice from the list and return the remainder\n")),
    ("llGetListEntryType",(["src","index"],"Returns the type of the index entry in the list\n(TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list)\n")),
    ("llList2CSV",(["src"],"Create a string of comma separated values from list\n")),
    ("llCSV2List",(["src"],"Create a list from a string of comma separated values\n")),
    ("llListRandomize",(["src","stride"],"Returns a randomized list of blocks of size stride\n")),
    ("llList2ListStrided",(["src","start","end","stride"],"Copy the strided slice of the list from start to end\n")),
    ("llGetRegionCorner",([],"Returns a vector with the south west corner x,y position of the region the object is in\n")),
    ("llListInsertList",(["dest","src","start"],"Inserts src into dest at position start\n")),
    ("llListFindList",(["src","test"],"Returns the start of the first instance of test in src, -1 if not found\n")),
    ("llGetObjectName",([],"Returns the name of the object script is attached to\n")),
    ("llSetObjectName",(["name"],"Sets the objects name\n")),
    ("llGetDate",([],"Gets the date as YYYY-MM-DD\n")),
    ("llEdgeOfWorld",(["pos","dir"],"Checks to see whether the border hit by dir from pos is the edge of the world (has no neighboring simulator)\n")),
    ("llGetAgentInfo",(["id"],"Gets information about agent ID.\nReturns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING and/or AGENT_IN_AIR.\n")),
    ("llAdjustSoundVolume",(["volume"],"adjusts volume of attached sound (0.0 - 1.0)\n")),
    ("llSetSoundQueueing",(["queue"],"determines whether attached sound calls wait for the current sound to finish (0 = no [default], nonzero = yes)\n")),
    ("llSetSoundRadius",(["radius"],"establishes a hard cut-off radius for audibility of scripted sounds (both attached and triggered)\n")),
    ("llKey2Name",(["id"],"Returns the name of the object key, iff the object is in the current simulator, otherwise the empty string\n")),
    ("llSetTextureAnim",(["mode","face","sizex","sizey","start","length","rate"],"Animate the texture on the specified face/faces\n")),
    ("llTriggerSoundLimited",(["sound","volume","tne","bsw"],"plays sound at volume (0.0 - 1.0), centered at but not attached to object, limited to AABB defined by vectors top-north-east and bottom-south-west\n")),
    ("llEjectFromLand",(["pest"],"Ejects pest from land that you own\n")),
    ("llParseString2List",(["src","separators","spacers"],"Breaks src into a list, discarding separators, keeping spacers (separators and spacers must be lists of strings, maximum of 8 each)\n")),
    ("llOverMyLand",(["id"],"Returns TRUE if id is over land owner of object owns, FALSE otherwise\n")),
    ("llGetLandOwnerAt",(["pos"],"Returns the key of the land owner, NULL_KEY if public\n")),
    ("llGetNotecardLine",(["name","line"],"Returns line line of notecard name via the dataserver event\n")),
    ("llGetAgentSize",(["id"],"If the agent is in the same sim as the object, returns the size of the avatar\n")),
    ("llSameGroup",(["id"],"Returns TRUE if ID is in the same sim and has the same active group, otherwise FALSE\n")),
    ("llUnSit",(["id"],"If agent identified by id is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up\n")),
    ("llGroundSlope",(["v"],"returns the ground slope below the object position + v\n")),
    ("llGroundNormal",(["v"],"returns the ground normal below the object position + v\n")),
    ("llGroundContour",(["v"],"returns the ground contour below the object position + v\n")),
    ("llGetAttached",([],"returns the object attachment point or 0 if not attached\n")),
    ("llGetFreeMemory",([],"returns the available heap space for the current script\n")),
    ("llGetFreeURLs",([],"Returns an integer that is the number of available URLs.\n")),
    ("llGetRegionName",([],"returns the current region name\n")),
    ("llGetRegionTimeDilation",([],"returns the current time dilation as a float between 0 and 1\n")),
    ("llGetRegionFPS",([],"returns the mean region frames per second\n")),
    ("llParticleSystem",(["rules"],"Creates a particle system based on rules.  Empty list removes particle system from object.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]\n")),
    ("llGroundRepel",(["height","water","tau"],"Critically damps to height if within height*0.5 of level (either above ground level or above the higher of land and water if water == TRUE)\n")),
    ("llGiveInventoryList",(["destination","category","inventory"],"Give inventory to destination in a new category\n")),
    ("llSetVehicleType",(["type"],"sets vehicle to one of the default types\n")),
    ("llSetVehicleFloatParam",(["param","value"],"sets the specified vehicle float parameter\n")),
    ("llSetVehicleVectorParam",(["param","vec"],"sets the specified vehicle vector parameter\n")),
    ("llSetVehicleRotationParam",(["param","rot"],"sets the specified vehicle rotation parameter\n")),
    ("llSetVehicleFlags",(["flags"],"sets the enabled bits in 'flags'\n")),
    ("llRemoveVehicleFlags",(["flags"],"removes the enabled bits in 'flags'\n")),
    ("llSitTarget",(["offset","rot"],"Set the sit location for this object (if offset == &lt;0,0,0&gt; clear it)\n")),
    ("llAvatarOnSitTarget",([],"If an avatar is sitting on the sit target, return the avatar's key, NULL_KEY otherwise\n")),
    ("llAddToLandPassList",(["avatar","hours"],"Add avatar to the land pass list for hours\n")),
    ("llSetTouchText",(["text"],"Displays text in pie menu that acts as a touch\n")),
    ("llSetSitText",(["text"],"Displays text rather than sit in pie menu\n")),
    ("llSetCameraEyeOffset",(["offset"],"Sets the camera eye offset used in this object if an avatar sits on it\n")),
    ("llSetCameraAtOffset",(["offset"],"Sets the camera at offset used in this object if an avatar sits on it\n")),
    ("llDumpList2String",(["src","separator"],"Write the list out in a single string using separator between values\n")),
    ("llScriptDanger",(["pos"],"Returns true if pos is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts\n")),
    ("llDialog",(["avatar","message","buttons","chat_channel"],"Shows a dialog box on the avatar's screen with the message.\nUp to 12 strings in the list form buttons.\nIf a button is clicked, the name is chatted on chat_channel.\n")),
    ("llVolumeDetect",(["detect"],"If detect = TRUE, object becomes phantom but triggers collision_start and collision_end events\nwhen other objects start and stop interpenetrating.\nMust be applied to the root object.\n")),
    ("llResetOtherScript",(["name"],"Resets script name\n")),
    ("llGetScriptState",(["name"],"Resets TRUE if script name is running\n")),
    ("llRemoteLoadScript",([],"Deprecated.  Please use llRemoteLoadScriptPin instead.\n")),
    ("llSetRemoteScriptAccessPin",(["pin"],"If pin is set to a non-zero number, the task will accept remote script\nloads via llRemoteLoadScriptPin if it passes in the correct pin.\nOthersise, llRemoteLoadScriptPin is ignored.\n")),
    ("llRemoteLoadScriptPin",(["target","name","pin","running","start_param"],"If the owner of the object this script is attached can modify target,\nthey are in the same region,\nand the matching pin is used,\ncopy script name onto target,\nif running == TRUE, start the script with param.\n")),
    ("llOpenRemoteDataChannel",([],"Creates a channel to listen for XML-RPC calls.  Will trigger a remote_data event with channel id once it is available.\n")),
    ("llSendRemoteData",(["channel","dest","idata","sdata"],"Send an XML-RPC request to dest through channel with payload of channel (in a string), integer idata and string sdata.\nA message identifier key is returned.\nAn XML-RPC reply will trigger a remote_data event and reference the message id.\nThe message_id is returned.\n")),
    ("llRemoteDataReply",(["channel","message_id","sdata","idata"],"Send an XML-RPC reply to message_id on channel with payload of string sdata and integer idata\n")),
    ("llCloseRemoteDataChannel",(["channel"],"Closes XML-RPC channel.\n")),
    ("llMD5String",(["src","nonce"],"Performs a RSA Data Security, Inc. MD5 Message-Digest Algorithm on string with nonce.  Returns a 32 character hex string.\n")),
    ("llSetPrimitiveParams",(["rules"],"Set primitive parameters based on rules.\n")),
    ("llStringToBase64",(["str"],"Converts a string to the Base 64 representation of the string.\n")),
    ("llBase64ToString",(["str"],"Converts a Base 64 string to a conventional string.  If the conversion creates any unprintable characters, they are converted to spaces.\n")),
    ("llXorBase64Strings",(["s1","s2"],"DEPRECATED!  Please use llXorBase64StringsCorrect instead!!  Incorrectly performs an exclusive or on two Base 64 strings and returns a Base 64 string.  s2 repeats if it is shorter than s1.  Retained for backwards compatability.\n")),
    ("llRemoteDataSetRegion",([],"If an object using remote data channels changes regions, you must call this function to reregister the remote data channels.\nYou do not need to make this call if you don't change regions.\n")),
    ("llLog10",(["val"],"Returns the base 10 log of val if val > 0, otherwise returns 0.\n")),
    ("llLog",(["val"],"Returns the base e log of val if val > 0, otherwise returns 0.\n")),
    ("llGetAnimationList",(["id"],"Gets a list of all playing animations for avatar id\n")),
    ("llSetParcelMusicURL",(["url"],"Sets the streaming audio URL for the parcel object is on\n")),
    ("llGetRootPosition",([],"Gets the global position of the root object of the object script is attached to\n")),
    ("llGetRootRotation",([],"Gets the global rotation of the root object of the object script is attached to\n")),
    ("llGetObjectDesc",([],"Returns the description of the object the script is attached to\n")),
    ("llSetObjectDesc",(["name"],"Sets the object's description\n")),
    ("llGetCreator",([],"Returns the creator of the object\n")),
    ("llGetTimestamp",([],"Gets the timestamp in the format: YYYY-MM-DDThh:mm:ss.ff..fZ\n")),
    ("llSetLinkAlpha",(["linknumber","alpha","face"],"If a prim exists in the link chain at linknumber, set face to alpha\n")),
    ("llGetNumberOfPrims",([],"Returns the number of prims in a link set the script is attached to\n")),
    ("llGetNumberOfNotecardLines",(["name"],"Returns number of lines in notecard 'name' via the dataserver event (cast return value to integer)\n")),
    ("llGetBoundingBox",(["object"],"Returns the bounding box around an object (including any linked prims) relative to the root prim, in a list:  [ (vector) min_corner, (vector) max_corner ]\n")),
    ("llGetGeometricCenter",([],"Returns the geometric center of the linked set the script is attached to.\n")),
    ("llGetHTTPHeader",(["request_id", "header"],"Returns a string that is the value for header for request_id.\n")),
    ("llGetPrimitiveParams",(["params"],"Gets primitive parameters specified in the params list.\n")),
    ("llIntegerToBase64",(["number"],"Big endian encode of of integer as a Base64 string.\n")),
    ("llBase64ToInteger",(["str"],"Big endian decode of a Base64 string into an integer.\n")),
    ("llGetGMTclock",([],"Gets the time in seconds since midnight in GMT\n")),
    ("llGetSimulatorHostname",([],"Gets the hostname of the machine script is running on (same as string in viewer Help dialog)\n")),
    ("llSetLocalRot",(["rot"],"sets the rotation of a child prim relative to the root prim\n")),
    ("llParseStringKeepNulls",(["src","separators","spacers"],"Breaks src into a list, discarding separators, keeping spacers (separators and spacers must be lists of strings, maximum of 8 each), keeping any null values generated.\n")),
    ("llRezAtRoot",(["inventory","pos","vel","rot","param"],"Instantiate owner's inventory object at pos with velocity vel and rotation rot with start parameter param.\nThe last selected root object's location will be set to pos\n")),
    ("llGetObjectPermMask",(["mask"],"Returns the requested permission mask for the root object the task is attached to.\n")),
    ("llSetObjectPermMask",(["mask","value"],"Sets the given permission mask to the new value on the root object the task is attached to.\n")),
    ("llGetInventoryPermMask",(["item","mask"],"Returns the requested permission mask for the inventory item.\n")),
    ("llSetInventoryPermMask",(["item","mask","value"],"Sets the given permission mask to the new value on the inventory item.\n")),
    ("llGetInventoryCreator",(["item"],"Returns the key for the creator of the inventory item.\n")),
    ("llOwnerSay",(["msg"],"says msg to owner only (if owner in sim)\n")),
    ("llRequestSimulatorData",(["simulator","data"],"Requests data about simulator.  When data is available the dataserver event will be raised\n")),
    ("llForceMouselook",(["mouselook"],"If mouselook is TRUE any avatar that sits on this object is forced into mouselook mode\n")),
    ("llGetObjectMass",(["id"],"Get the mass of the object with key id\n")),
    ("llListReplaceList",(["dest","src","start","end"],"Replaces start through end of dest with src.\n")),
    ("llLoadURL",(["avatar_id","message","url"],"Shows dialog to avatar avatar_id offering to load web page at URL.  If user clicks yes, launches their web browser.\n")),
    ("llParcelMediaCommandList",(["command"],"Sends a list of commands, some with arguments, to a parcel.\n")),
    ("llParcelMediaQuery",(["query"],"Sends a list of queries, returns a list of results.\n")),
    ("llModPow",(["a","b","c"],"Returns a raised to the b power, mod c. ( (a**b)%c ).  b is capped at 0xFFFF (16 bits).\n")),
    ("llGetInventoryType",(["name"],"Returns the type of the inventory name\n")),
    ("llSetPayPrice",(["price","quick_pay_buttons"],"Sets the default amount when someone chooses to pay this object.\n")),
    ("llGetCameraPos",([],"Gets current camera position for agent task has permissions for.\n")),
    ("llGetCameraRot",([],"Gets current camera orientation for agent task has permissions for.\n")),
    ("llSetPrimURL",(["url"],"Updates the URL for the web page shown on the sides of the object.\n")),
    ("llRefreshPrimURL",([],"Reloads the web page shown on the sides of the object.\n")),
    ("llEscapeURL",(["url"],"Returns and escaped/encoded version of url, replacing spaces with %20 etc.\n")),
    ("llUnescapeURL",(["url"],"Returns and unescaped/unencoded version of url, replacing %20 with spaces etc.\n")),
    ("llMapDestination",(["simname","pos","look_at"],"Opens world map centered on region with pos highlighted.\nOnly works for scripts attached to avatar, or during touch events.\n(NOTE: look_at currently does nothing)\n")),
    ("llAddToLandBanList",(["avatar","hours"],"Add avatar to the land ban list for hours\n")),
    ("llRemoveFromLandPassList",(["avatar"],"Remove avatar from the land pass list\n")),
    ("llRemoveFromLandBanList",(["avatar"],"Remove avatar from the land ban list\n")),
    ("llSetCameraParams",(["rules"],"Sets multiple camera parameters at once.\nList format is [ rule1, data1, rule2, data2 . . . rulen, datan ]\n")),
    ("llClearCameraParams",([],"Resets all camera parameters to default values and turns off scripted camera control.\n")),
    ("llListStatistics",(["operation","l"],"Perform statistical aggregate functions on list l using LIST_STAT_* operations.\n")),
    ("llGetUnixTime",([],"Get the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.\n")),
    ("llGetParcelFlags",(["pos"],"Get the parcel flags (PARCEL_FLAG_*) for the parcel including the point pos.\n")),
    ("llGetRegionFlags",([],"Get the region flags (REGION_FLAG_*) for the region the object is in.\n")),
    ("llXorBase64StringsCorrect",(["s1","s2"],"Correctly performs an exclusive or on two Base 64 strings and returns a Base 64 string.  s2 repeats if it is shorter than s1.\n")),
    ("llHTTPRequest",(["url","parameters","body"],"Send an HTTP request.\n")),
    ("llHTTPResponse",(["request_id", "status", "body"],"Responds to request_id with status and body.\n")),
    ("llResetLandBanList",([],"Removes all residents from the land ban list.\n")),
    ("llResetLandPassList",([],"Removes all residents from the land access/pass list.\n")),
    ("llGetObjectPrimCount",(["object_id"],"Returns the total number of prims for an object.\n")),
    ("llGetParcelPrimOwners",(["pos"],"Returns a list of all residents who own objects on the parcel and the number of objects they own.\nRequires owner-like permissions for the parcel.\n")),
    ("llGetParcelPrimCount",(["pos","category","sim_wide"],"Gets the number of prims on the parcel of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\n")),
    ("llGetParcelMaxPrims",(["pos","sim_wide"],"Gets the maximum number of prims allowed on the parcel at pos.\n")),
    ("llGetParcelDetails",(["pos","params"],"Gets the parcel details specified in params for the parcel at pos.\nParams is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA\n")),
    ("llSetLinkPrimitiveParams",(["linknumber","rules"],"Set primitive parameters for linknumber based on rules.\n")),
    ("llSetLinkTexture",(["link_pos","texture","face"],"Sets the texture of face for link_pos\n")),
    ("llStringTrim",(["src","trim_type"],"Trim leading and/or trailing spaces from a string.\nUses trim_type of STRING_TRIM, STRING_TRIM_HEAD or STRING_TRIM_TAIL.\n")),
    ("llSHA1String", (["src"], "Returns a string of 40 hex characters that is the SHA1 security hash of src.\n")),
    ("llDetectedTouchBinormal", (["index"], "Returns a vector that is the surface binormal (tangent to the surface) where the touch event was triggered.\n")),
    ("llDetectedTouchFace", (["index"], "Returns an integer that is the index of the face the avatar clicked on.\n")),
    ("llDetectedTouchNormal", (["index"], "Returns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered.\n")),
    ("llDetectedTouchPos", (["index"], "Returns a vector that is the position where the object was touched in region coordinates, unless it is attached to the HUD, in which case it returns the position relative to the attach point.\n")),
    ("llDetectedTouchST", (["index"], "Returns a vector that is the surface coordinates for where the prim was touched. The x & y vector positions contain the horizontal (s) & vertical (t) face coordinates respectively (<s, t, 0.0>). Each component is in the interval [0.0, 1.0].\n")),
    ("llDetectedTouchUV", (["index"], "Returns a vector that is the texture coordinates for where the prim was touched. The x & y vector positions contain the u & v face coordinates respectively (<u, v, 0.0>).\n")),
    ("llGetRegionAgentCount", ([], "Returns an integer that is the number of avatars in the region.\n")),
    ("llGetAgentLanguage", (["key"], "Returns a string that is the language code of the preferred interface language of the user avatar.\n")),
    ("llReleaseURL", (["url"], "Releases the specified URL, it will no longer be usable.\n")),
    ("llRequestSecureURL", ([], "Requests one HTTPS:// (SSL) url for use by this object. The http_request event is tiggered with results.\n")),
    ("llRequestURL", ([], "Requests one HTTP:// url for use by this object. The http_request event is tiggered with results.\n")),
    ("llCastRay",(["start","end","options"],"Start and end are vectors specifying the start and end point of the ray. The ray must both start and end within the region where the script is located or a script runtime error will be generated. (So be sure to clamp your values!)\n")),
    ("llClearPrimMedia",(["face"],"Clears (deletes) the media and all params from the given face.\n")),
    ("llGetDisplayName",(["id"],"Returns a string that is the non-unique display name of the avatar specified by id.\n")),
    ("llGetEnv",(["name"],"Returns a string with the requested data about the region.\n")),
    ("llGetLinkNumberOfSides",(["link"],"Returns an integer that is the number of faces (or sides) of the prim link.\n")),
    ("llGetPrimMediaParams",(["face","params"],"Get the media params for a particular face on an object, given the desired list of names.\n")),
    ("llGetUsername",(["id"],"Returns a string that is the unique username of the avatar specified by id.\n")),
    ("llRequestDisplayName",(["id"],"Requests the Display Name of the agent identified by id. When the Display Name is available the dataserver event will be raised. The agent identified by id does not need to be in the same region or online at the time of the request.\n")),
    ("llRequestUsername",(["id"],"Requests the Username of the agent identified by id. When Username is available the dataserver event will be raised. The agent identified by id does not need to be in the same region or online at the time of the request.\n")),
    ("llSetPrimMediaParams",(["face","params"],"Set the media params for a particular face.\n")),
    ("llSetLinkPrimitiveParamsFast",(["linknumber","rules"],".Set primitive parameters for linknumber based on rules with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams except without the delay.\n")),
    ("llGetLinkPrimitiveParams",(["link","params"],"Identical to llGetPrimitiveParams except that it acts on the prim specified by the link number given.\n")),
    ("llLinkParticleSystem",(["link","rules"],"A particle system defined by a list of rules is set for the prim(s) link. This is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in.\n")),
    ("llSetLinkTextureAnim",(["link","mode","face","sizex","sizey","start","length","rate"],"Animate the texture on the specified face/faces of the specified prim/prims by setting the texture scale and offset. Identical to llSetTextureAnim except able to modify any prim in the link set.\n")),
    ("llTextBox",(["avatar","message","chat_channel"],"Shows a dialog box on avatar's screen with the text message. It contains a text box for input, any text that is entered is said by avatar on chat_channel when the 'OK' button is clicked.\n")),
    ("llScriptProfiler",(["flags"],"Enables or disables the scripts profiling state.\n")),
    ("llGetSPMaxMemory",([],"Returns the integer of the most bytes used while LlScriptProfiler was last active.\n")),
    ("llGetUsedMemory",([],"Returns the integer of the number of bytes of memory currently in use by the script.\n")),
    ("llRegionSayTo", (["target","channel","msg"], "Says the text supplied in string msg on channel supplied in integer channel to the object or avatar specified by target\n")),
    ("llSetVelocity", (["force", "local"], "Applies velocity to object\ninteger local - boolean, if TRUE, force is treated as a local directional vector instead of region directional vector\n")),
    ("llSetAngularVelocity", (["force", "local"], "Applies rotational velocity to object.\ninteger local - boolean, if TRUE uses local axis, if FALSE uses region axis\n")),
    ("llLinkSitTarget", (["link","offset","rot"], "Set the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation.\n")),
    ("llAvatarOnLinkSitTarget", (["link"], "Returns a key that is the UUID of the user seated on the prim.\n")),
    ("llSetContentType", (["request_id","content_type"], "Set the Internet media type of an LSL HTTP server response. content_type: CONTENT_TYPE_TEXT, CONTENT_TYPE_HTML\n")),
    ("llSetLinkCamera", (["link","eye","at"], "Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim.\n")),
    ("llClearLinkMedia", (["link","face"], "Clears (deletes) the media and all params from the given face on the linked prim(s).\n")),
    ("llGetLinkMedia", (["link","face","params"], "Get the media params for a particular face on a link'ed prim, given the desired list of named params.\n")),
    ("llSetLinkMedia", (["link","face","params"], "Set the media params for a particular face on the linked prim(s) without a delay.\n")),
    ("llGetMemoryLimit", ([], "Get the maximum memory a script can use.\n")),
    ("llSetMemoryLimit", (["limit"], "Request limit bytes to be reserved for this script. Returns the integer TRUE or FALSE indicating if the memory limit was set.\n"))
    ]

